<template>
  <div>
    <table border="1">
      <tr>
        <th>标题</th>
        <th>图片</th>
      </tr>
      <tr v-for="a in all">
        <td>{{ a.username }}</td>
        <td><img :src="a.img" width="50px"></td>
      </tr>
    </table>
  </div>

</template>

<script>
    export default {
        name: "js",
      data(){
          return{
            all:[]
          }
      },
      mounted() {
          this.axios({
            url:'http://127.0.0.1:8000/jian/',
            method:'post',
            data:{
              username:this.$route.query.username

            }

          }).then(res=>{
            console.log(res);
            this.all = res.data.data;
            if (this.all.length == 0){
              alert('没有找到你要找的数据')
            }

          })
      }
    }
</script>

<style scoped>

</style>

